﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Manage.Master" AutoEventWireup="true"
    CodeBehind="MemberList.aspx.cs" Inherits="ZF.BLL.Admin.MemberList" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

    <script>
        function _openAddInte(id) {
            window.open('addInte.aspx?mid=' + id, '',
                                     'menubar=no,scrollbars=yes,resizable=yes,location=no,toolbar=no,width=420,height=20', true);
        }
    </script>

    <!--自定义条件 开始-->
    <%-- <div class="tabHeadMenu">
        <a href="MemberList.aspx?mt=1" class='<%=(MemberType==1)?"action":"" %>'>网站会员</a> <a
        <a href="MemberList.aspx?mt=100" class='<%=(MemberType==100)?"action":"" %>'>系统管理员</a>
    </div> --%>
    <!--自定义条件 结束-->
    <!--列表 开始-->
    <div class="tabContainer">
        <zf:GridView ID="gvList" runat="server" OnSorting="gvListSorting" OnPageIndexChanging="gvListPageChanging">
            <Columns>
                <zf:TemplateField IsKeyField="true" DefaultSortField="true" DefaultSortDirection="Descending"
                    SortExpression="Member.MemberId">
                    <ItemTemplate>
                        <asp:Label runat="server" ID="KeyLabel" Text='<%# Eval("Member.MemberId")%>'></asp:Label>
                    </ItemTemplate>
                </zf:TemplateField>
                <zf:TemplateField IsCheckField="true">
                </zf:TemplateField>
                <zf:TemplateField IsSerialNoField="true">
                </zf:TemplateField>
                <zf:TemplateField HeaderText="帐号">
                    <ItemTemplate>
                        <%#  Eval("Member.Account")%>
                    </ItemTemplate>
                </zf:TemplateField>
                <zf:TemplateField HeaderText="姓名">
                    <ItemTemplate>
                        <%#  Eval("Member.Contact")%>
                    </ItemTemplate>
                </zf:TemplateField>
                <zf:TemplateField HeaderText="上传认证" Visible="false">
                    <ItemTemplate>
                        <a href="/photo/member/<%#  Eval("Member.ImgBusCard")%>" class="<%#  Eval("Member.ImgBusCard") == null ? "dn_" : ""%>"
                            target="_blank">
                            <img src="/image/busimg.gif" /></a>&nbsp; <a href="/photo/member/<%#  Eval("Member.ImgIDCard")%>"
                                class="<%#  Eval("Member.ImgIDCard") == null ? "dn_" : ""%>" target="_blank">
                                <img src="/image/idcardimg.gif" /></a> <a href="/photo/member/<%#  Eval("Member.ImgLicence")%>"
                                    class="<%#  Eval("Member.ImgLicence") == null ? "dn_" : ""%>" target="_blank">
                                    <img src="/image/licimg.gif" /></a>
                    </ItemTemplate>
                </zf:TemplateField>
                <%-- <zf:TemplateField HeaderText="注册时间"  DefaultSortDirection="Ascending" SortExpression="Member.AddTime">
                    <ItemTemplate>
                        <%#  Eval("Member.AddTime")%>
                    </ItemTemplate>
                </zf:TemplateField>--%>
                <%--  <zf:TemplateField HeaderText="状态">
                    <ItemTemplate>
                        <%#  GetStatus((int)Eval("Member.Status"))%>
                        
                    </ItemTemplate>
                </zf:TemplateField>--%>
                <zf:TemplateField HeaderText="区域" Visible="false">
                    <ItemTemplate>
                        <%# Eval("Member.Area") %><%--(<%# ((string)Eval("Member.Area")).EmptyString("--") %>)--%>
                    </ItemTemplate>
                </zf:TemplateField>
                <zf:TemplateField HeaderText="资格管理" Visible="false">
                    <ItemTemplate>
                        <zf:LinkButton ID="LinkBut1ton2" runat="server" OnClick="Cancel" CommandArgument='<%# Eval("Member.MemberId") %>'
                            OnClientClick="return confirm('是否确定要取消该专家顾问的资格');">取消资格</zf:LinkButton>
                    </ItemTemplate>
                </zf:TemplateField>
                <zf:TemplateField HeaderText="赠送积分">
                    <ItemTemplate>
                        <a href="javascript:_openAddInte(<%# Eval("Member.MemberId")%>)">赠送</a>
                    </ItemTemplate>
                </zf:TemplateField>
                <zf:TemplateField HeaderText="推荐设置" Visible="false" SortExpression="Member.IsRecommend">
                    <ItemTemplate>
                        <zf:LinkButton ID="LinkButton2" runat="server" OnClick="TJ" CommandArgument='<%# Eval("Member.MemberId") %>'
                             ><%# (bool)Eval("Member.IsRecommend") ? "取消" : "启用"%></zf:LinkButton>
                    </ItemTemplate>
                </zf:TemplateField>
                <zf:TemplateField HeaderText="主页" Visible="false">
                    <ItemTemplate>
                        <a href='/expert/info.aspx?id=<%# Eval("Member.MemberId")%>' target="_blank">连接</a>
                    </ItemTemplate>
                </zf:TemplateField>
                <zf:TemplateField HeaderText="操作">
                    <ItemTemplate>
                    <span  class="<%=this.MemberType==100?"":"dn_"%>">
                    <a href='MemberRight.aspx?mid=<%# Eval("Member.MemberId")%>'>权限</a> | </span>
                    
                        <a href='MemberInfo.aspx?mid=<%# Eval("Member.MemberId")%>'>查看</a> | <a href="IntegralLog.aspx?id=<%# Eval("Member.MemberId")%>">
                            积分</a> |
                        <zf:LinkButton ID="LinkButton1" runat="server" OnClick="Delete" CommandArgument='<%# Eval("Member.MemberId") %>'
                            OnClientClick="return confirm('是否确定要删除此记录');">删除</zf:LinkButton>
                    </ItemTemplate>
                </zf:TemplateField>
            </Columns>
        </zf:GridView>
    </div>
    <!--列表 结束-->
    <div class="mt5_ fc_">
    </div>
    <!--自定义按钮 开始-->
    <div class="btnContainer mt10_">
        <span class="fl_ mr10_">
            <input type="checkbox" class="checkAll" bind=".tab" />选中本页显示的所有记录</span>
        <zf:LinkButton ID="LinkButton1" runat="server" OnClick="Delete" CommandArgument='select'
            OnClientClick="return confirm('是否确定要删除选中记录');">删除选中的记录</zf:LinkButton>
        <span class="<%=(MemberType==100)?"":"dn_" %>"><a href="MemberManage.aspx?ot=AddNew">
            添加系统管理员</a> </span>
    </div>
    <!--自定义按钮 结束-->
    <div class="fc_ mt10_">
    </div>
    <!--搜索 开始-->
    <div class="searchContainer">
        <table>
            <tr>
                <td class="l">
                    搜索选项:
                </td>
                <td class="m">
                    <div class="c">
                        <span class="t">会员帐号:</span><span class="c">
                            <zf:TextBox runat="server" class="stxt" ID="tbAccount"></zf:TextBox></span>
                        <span class="t">会员名称:</span><span class="c">
                            <zf:TextBox runat="server" class="stxt" ID="tbName"></zf:TextBox></span>
                        <div>
                            <span class="t">&nbsp;&nbsp;&nbsp;&nbsp;类型:</span><span class="c">
                                <zf:DropDownList runat="server" ID="ddlType" class="stxt" AppendDataBoundItems="true">
                                    <asp:ListItem Value="0" Text="未选择"></asp:ListItem>
                                    <asp:ListItem Value="1" Text="风水师"></asp:ListItem>
                                    <asp:ListItem Value="2" Text="设计师"></asp:ListItem>
                                    <asp:ListItem Value="3" Text="地产顾问"></asp:ListItem>
                                    <asp:ListItem Value="4" Text="房贷顾问"></asp:ListItem>
                                </zf:DropDownList>
                            </span>
                        </div>
                        <div>
                            <div class="fysearch">
                                <% var sp = new ZF.WS.house.Search(); %>
                                <zf:TextBox runat="server" class="dttxt dn_ " ID="tbArea1" Text=""></zf:TextBox>
                                <zf:TextBox runat="server" class="dttxt dn_ " ID="tbArea2" Text=""></zf:TextBox>

                                <script>
                                    var fyareajson = $.evalJSON('<%=sp.AreaChilds.JsonConvert() %>');
                                </script>

                                <span class="t">&nbsp;&nbsp;&nbsp;&nbsp;区域:</span><span class="c">
                                    <select class=" area1" class="ddl">
                                        <option value='' selected="selected">不 限</option>
                                    </select>
                                </span><span class="t">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;商圈:</span><span
                                    class="c">
                                    <select class=" area2" class="ddl">
                                        <option value=''>不 限</option>
                                    </select>
                                </span>
                            </div>

                            <script>
                                var fysearch = $(".fysearch");
                                var area1 = fysearch.find(".area1")
                                var area1Value = $(".tbArea1").val();

                                $(fyareajson).each(function() {
                                    area1.append(String.format("<option value='{0}' {2}>{1}</option>", this.Name, this.Name,
                                (this.Id + "" == area1Value) ? 'selected=selected' : ''));
                                });
                                $(function() {
                                    fysearch.find(".area1").change(function() {
                                        var selId = this.value;

                                        $(".tbArea1").val(this.value);
                                        $(".tbArea2").val("");
                                        var area2 = fysearch.find(".area2");
                                        area2.find("option").remove();
                                        area2.append("<option value='0'>不 限</option>");
                                        var area1json = null;
                                        $(fyareajson).each(function() {
                                            if (this.Id + "" == selId) {
                                                area1json = this;
                                                return false;
                                            }
                                        });
                                        if (area1json != null) {
                                            $(area1json.Childs).each(function() {
                                                area2.append(String.format("<option value='{0}'>{1}</option>", this.Id, this.Name));
                                            });
                                        }
                                    });
                                    fysearch.find(".area2").change(function() {
                                        $(".tbArea2").val(this.value);
                                    });
                                });
                            </script>

                        </div>
                        <zf:Button runat="server" ID="Button2" Text="搜 索" OnClick="Search" class="linkbtn" />
                        <zf:Button runat="server" ID="Button1" Text="全 部" OnClick="AllList" class="linkbtn" />
                    </div>
                </td>
            </tr>
        </table>
    </div>
    <!--搜索 结束-->
</asp:Content>
